//package com.easyexcle.demo.easyExcel.style;
//
//import com.alibaba.excel.metadata.Head;
//
//
//import com.alibaba.excel.write.handler.CellWriteHandler;
//
//import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
//import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
//import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
//
//import com.alibaba.excel.write.metadata.style.WriteCellStyle;
//import com.alibaba.excel.write.metadata.style.WriteFont;
//import com.alibaba.excel.write.style.AbstractCellStyleStrategy;
//import com.alibaba.excel.write.style.AbstractVerticalCellStyleStrategy;
//
//import org.apache.poi.ss.usermodel.*;
//import org.apache.poi.xssf.usermodel.XSSFCellStyle;
//import org.apache.poi.xssf.usermodel.XSSFFont;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//
//import java.util.Arrays;
//import java.util.List;
//
//
///**
// * @Author: lkz
// * @Title: DynamicHeadHorizontalCellStyleStrategy
// * @Description: 动态表头 表头：值 版本3.1.1
// * @Date: 2023/6/25 10:33
// */
//
//public class DynamicHeadHorizontalCellStyleStrategy  extends AbstractVerticalCellStyleStrategy  {
//
//
//
//
//    @Override
//    protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) {
//        Integer columnIndex = context.getColumnIndex();
//        // 获取样式实例
//        WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//
//        // 设置字体
//        WriteFont contentWriteFont = new WriteFont();
//        if(columnIndex==0){
//            contentWriteFont.setColor(IndexedColors.WHITE1.getIndex());
//        }
//        contentWriteFont.setFontHeightInPoints((short) 12);//设置字体大小
//        contentWriteFont.setFontName("宋体"); //设置字体名字
//        contentWriteCellStyle.setWriteFont(contentWriteFont);//在样式用应用设置的字体;
//        //设置样式;
//        contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框;
//        contentWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色;
//        contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);  //设置左边框;
//        contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色;
//        contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框;
//        contentWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色;
//        contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框;
//        contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边框颜色;
//
//        contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// 水平居中
//        contentWriteCellStyle.setWrapped(true); //设置自动换行;
//        contentWriteCellStyle.setShrinkToFit(true);//设置文本收缩至合适
//        if(columnIndex==0){
//            contentWriteCellStyle.setFillForegroundColor(IndexedColors.BLUE_GREY.getIndex());
//          //  contentWriteCellStyle.setFillBackgroundColor(IndexedColors.BLUE_GREY.getIndex());
//            contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
//        }
//
//        return contentWriteCellStyle;
//
//
//    }
//
//
//
//}
